/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.dp1.pucp.Produccion.Vista;

import com.dp1.pucp.Modelo.Clases.Demanda;
import com.dp1.pucp.Util.Validaciones;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Rodrigo
 */
public class ConsultaPedidosGUI extends javax.swing.JPanel {

    private JFrame padre;
    /**
     * Creates new form ConsultaPedidosGUI
     */
    
    
    public JFrame getPadre(){ return padre; }
    
    public JTable getTabla(){
        //para que el controlador actualize la tabla
        return this.tblPedidos;
    }
    
    public ConsultaPedidosGUI() {
        initComponents();
    }
    
    public JTable getTabla1(){
        
        return this.tblTurno1;
        
    }
    
    public JTable getTabla2(){
        
        return this.tblTurno2;
        
    }
    
    public JTable getTabla3(){
        
        return this.tblTurno3;
        
    }
    
    public void llenarTurnos(Demanda demanda1, Demanda demanda2, Demanda demanda3){
        
        //Tabla 1
        ((DefaultTableModel) this.getTabla1().getModel()).setRowCount(0);
        int i=0;
        if (demanda1.getCantPedNormal()>0){
            ((DefaultTableModel) this.getTabla1().getModel()).setRowCount(this.getTabla1().getRowCount()+1);
            this.getTabla1().setValueAt("Galleta Soda",i,0); 
            this.getTabla1().setValueAt(demanda1.getCantPedNormal(), i, 1);
            i++;
        }
        if (demanda1.getCantPedDec()>0){
            ((DefaultTableModel) this.getTabla1().getModel()).setRowCount(this.getTabla1().getRowCount()+1);
            this.getTabla1().setValueAt("Galleta Decorada",i,0); 
            this.getTabla1().setValueAt(demanda1.getCantPedDec(), i, 1);  
            i++;
        } 
        if (demanda1.getCantPedRell()>0){
            ((DefaultTableModel) this.getTabla1().getModel()).setRowCount(this.getTabla1().getRowCount()+1);
            this.getTabla1().setValueAt("Galleta Rellena",i,0); 
            this.getTabla1().setValueAt(demanda1.getCantPedRell(), i, 1);          
        } 
        
        //Tabla 2
        ((DefaultTableModel) this.getTabla2().getModel()).setRowCount(0);
        i=0;
        if (demanda2.getCantPedNormal()>0){
            ((DefaultTableModel) this.getTabla2().getModel()).setRowCount(this.getTabla2().getRowCount()+1);
            this.getTabla2().setValueAt("Galleta Soda",i,0); 
            this.getTabla2().setValueAt(demanda2.getCantPedNormal(), i, 1);
            i++;
        }
        if (demanda2.getCantPedDec()>0){
            ((DefaultTableModel) this.getTabla2().getModel()).setRowCount(this.getTabla2().getRowCount()+1);
            this.getTabla2().setValueAt("Galleta Decorada",i,0); 
            this.getTabla2().setValueAt(demanda2.getCantPedDec(), i, 1);      
            i++;
        } 
        if (demanda2.getCantPedRell()>0){
            ((DefaultTableModel) this.getTabla2().getModel()).setRowCount(this.getTabla2().getRowCount()+1);
            this.getTabla2().setValueAt("Galleta Rellena",i,0); 
            this.getTabla2().setValueAt(demanda2.getCantPedRell(), i, 1);          
        } 
        
        //Tabla 3
        ((DefaultTableModel) this.getTabla3().getModel()).setRowCount(0);
        i=0;
        if (demanda3.getCantPedNormal()>0){
            ((DefaultTableModel) this.getTabla3().getModel()).setRowCount(this.getTabla3().getRowCount()+1);
            this.getTabla3().setValueAt("Galleta Soda",i,0); 
            this.getTabla3().setValueAt(demanda3.getCantPedNormal(), i, 1);
            i++;
        }
        if (demanda3.getCantPedDec()>0){
            ((DefaultTableModel) this.getTabla3().getModel()).setRowCount(this.getTabla3().getRowCount()+1);
            this.getTabla3().setValueAt("Galleta Decorada",i,0); 
            this.getTabla3().setValueAt(demanda3.getCantPedDec(), i, 1);  
            i++;
        } 
        if (demanda3.getCantPedRell()>0){
            ((DefaultTableModel) this.getTabla3().getModel()).setRowCount(this.getTabla3().getRowCount()+1);
            this.getTabla3().setValueAt("Galleta Rellena",i,0); 
            this.getTabla3().setValueAt(demanda3.getCantPedRell(), i, 1);          
        } 
        
        
        
        
    }
    

    
    public int getGalletaSodaTurno1(){   
        int valor=0;
        for (int i=0;i<this.getTabla1().getRowCount();i++){
            if (this.getTabla1().getValueAt(i, 0)=="Galleta Soda"){
                valor=(int)this.getTabla1().getValueAt(i, 1);
                valor=valor/30;
            }
        }
        return valor;
    }
    
    public int getGalletaSodaTurno2(){   
        int valor=0;
        for (int i=0;i<this.getTabla2().getRowCount();i++){
            if (this.getTabla2().getValueAt(i, 0)=="Galleta Soda"){
                valor=(int)this.getTabla2().getValueAt(i, 1);
                valor=valor/30;
            }
        }
//        if ("".equals(txtSodaTurno1.getText())){
//            return 0;
//        }
//        else {
//            return Integer.parseInt(txtSodaTurno1.getText());  
//        } 
        return valor;       
    }
    
    public int getGalletaSodaTurno3(){   
        int valor=0;
        for (int i=0;i<this.getTabla3().getRowCount();i++){
            if (this.getTabla3().getValueAt(i, 0)=="Galleta Soda"){
                valor=(int)this.getTabla3().getValueAt(i, 1);
                valor=valor/30;
            }
        }
//        if ("".equals(txtSodaTurno1.getText())){
//            return 0;
//        }
//        else {
//            return Integer.parseInt(txtSodaTurno1.getText());  
//        } 
        return valor;      
    }
    
    public int getGalletaDecoradaTurno1(){   
        int valor=0;
        for (int i=0;i<this.getTabla1().getRowCount();i++){
            if (this.getTabla1().getValueAt(i, 0)=="Galleta Decorada"){
                valor=(int)this.getTabla1().getValueAt(i, 1);
                valor=valor/30;
            }
        }
//        if ("".equals(txtSodaTurno1.getText())){
//            return 0;
//        }
//        else {
//            return Integer.parseInt(txtSodaTurno1.getText());  
//        } 
        return valor;       
    }
    
    public int getGalletaDecoradaTurno2(){   
        int valor=0;
        for (int i=0;i<this.getTabla2().getRowCount();i++){
            if (this.getTabla2().getValueAt(i, 0)=="Galleta Decorada"){
                valor=(int)this.getTabla2().getValueAt(i, 1);
                valor=valor/30;
            }
        }
//        if ("".equals(txtSodaTurno1.getText())){
//            return 0;
//        }
//        else {
//            return Integer.parseInt(txtSodaTurno1.getText());  
//        } 
        return valor;     
    }
    
    public int getGalletaDecoradaTurno3(){   
        int valor=0;
        for (int i=0;i<this.getTabla3().getRowCount();i++){
            if (this.getTabla3().getValueAt(i, 0)=="Galleta Decorada"){
                valor=(int)this.getTabla3().getValueAt(i, 1);
                valor=valor/30;
            }
        }
//        if ("".equals(txtSodaTurno1.getText())){
//            return 0;
//        }
//        else {
//            return Integer.parseInt(txtSodaTurno1.getText());  
//        } 
        return valor;       
    }
    
    public int getGalletaRellenaTurno1(){   
        int valor=0;
        for (int i=0;i<this.getTabla1().getRowCount();i++){
            if (this.getTabla1().getValueAt(i, 0)=="Galleta Rellena"){
                valor=(int)this.getTabla1().getValueAt(i, 1);
                valor=valor/30;
            }
        }
//        if ("".equals(txtSodaTurno1.getText())){
//            return 0;
//        }
//        else {
//            return Integer.parseInt(txtSodaTurno1.getText());  
//        } 
        return valor;       
    }
    
    public int getGalletaRellenaTurno2(){   
        int valor=0;
        for (int i=0;i<this.getTabla2().getRowCount();i++){
            if (this.getTabla2().getValueAt(i, 0)=="Galleta Rellena"){
                valor=(int)this.getTabla2().getValueAt(i, 1);
                valor=valor/30;
            }
        }
//        if ("".equals(txtSodaTurno1.getText())){
//            return 0;
//        }
//        else {
//            return Integer.parseInt(txtSodaTurno1.getText());  
//        } 
        return valor;         
    }
    
    public int getGalletaRellenaTurno3(){   
        int valor=0;
        for (int i=0;i<this.getTabla2().getRowCount();i++){
            if (this.getTabla2().getValueAt(i, 0)=="Galleta Rellena"){
                valor=(int)this.getTabla2().getValueAt(i, 1);
                valor=valor/30;
            }
        }
//        if ("".equals(txtSodaTurno1.getText())){
//            return 0;
//        }
//        else {
//            return Integer.parseInt(txtSodaTurno1.getText());  
//        } 
        return valor;        
    }
    
    
    
    public void addActualizarListener(ActionListener ml){ this.btnActualizar.addActionListener(ml); }
    public void addGuardarListener(ActionListener ml){ this.btnGuardar.addActionListener(ml); }
    public void addSimularTurno1Listener(ActionListener ml){ this.btnSimularTurno1.addActionListener(ml); }
    public void addSimularTurno2Listener(ActionListener ml){ this.btnSimularTurno2.addActionListener(ml); }
    public void addSimularTurno3Listener(ActionListener ml){ this.btnSimularTurno3.addActionListener(ml); }
    public void addAsignarTurno1Listener(ActionListener ml){ this.btnAsignarTurno1.addActionListener(ml); }
    public void addAsignarTurno2Listener(ActionListener ml){ this.btnAsignarTurno2.addActionListener(ml); }
    public void addAsignarTurno3Listener(ActionListener ml){ this.btnAsignarTurno3.addActionListener(ml); }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnEditar3 = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        jTextField13 = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jTextField14 = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jTextField15 = new javax.swing.JTextField();
        btnEditar7 = new javax.swing.JButton();
        btnEditar8 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblPedidos = new javax.swing.JTable();
        btnGuardar = new javax.swing.JButton();
        btnActualizar = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        btnSimularTurno1 = new javax.swing.JButton();
        btnAsignarTurno1 = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tblTurno1 = new javax.swing.JTable();
        jPanel9 = new javax.swing.JPanel();
        btnSimularTurno3 = new javax.swing.JButton();
        btnAsignarTurno3 = new javax.swing.JButton();
        jScrollPane5 = new javax.swing.JScrollPane();
        tblTurno3 = new javax.swing.JTable();
        jPanel10 = new javax.swing.JPanel();
        btnSimularTurno2 = new javax.swing.JButton();
        btnAsignarTurno2 = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        tblTurno2 = new javax.swing.JTable();

        btnEditar3.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnEditar3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/save.png"))); // NOI18N
        btnEditar3.setText("Guardar");
        btnEditar3.setBorderPainted(false);
        btnEditar3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnEditar3.setMaximumSize(new java.awt.Dimension(57, 29));
        btnEditar3.setMinimumSize(new java.awt.Dimension(57, 29));
        btnEditar3.setPreferredSize(new java.awt.Dimension(57, 29));
        btnEditar3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Demanda Turno Mañana"));

        jLabel13.setText("Soda");

        jLabel14.setText("Decorada");

        jLabel15.setText("Rellena");

        jTextField15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField15ActionPerformed(evt);
            }
        });

        btnEditar7.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnEditar7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/settings.png"))); // NOI18N
        btnEditar7.setText("Simular");
        btnEditar7.setBorderPainted(false);
        btnEditar7.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnEditar7.setMaximumSize(new java.awt.Dimension(57, 29));
        btnEditar7.setMinimumSize(new java.awt.Dimension(57, 29));
        btnEditar7.setPreferredSize(new java.awt.Dimension(57, 29));
        btnEditar7.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        btnEditar8.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnEditar8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/checkmark.png"))); // NOI18N
        btnEditar8.setText("Asignar");
        btnEditar8.setBorderPainted(false);
        btnEditar8.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnEditar8.setMaximumSize(new java.awt.Dimension(57, 29));
        btnEditar8.setMinimumSize(new java.awt.Dimension(57, 29));
        btnEditar8.setPreferredSize(new java.awt.Dimension(57, 29));
        btnEditar8.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(btnEditar7, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnEditar8, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel14)
                            .addComponent(jLabel15)
                            .addComponent(jLabel13))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextField13, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE)
                            .addComponent(jTextField14)
                            .addComponent(jTextField15))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(14, 14, 14)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnEditar7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnEditar8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Consulta Pedidos Producto Mensual"));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Pedidos"));

        tblPedidos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Código", "Fecha Registro", "Estado"
            }
        ));
        jScrollPane1.setViewportView(tblPedidos);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 471, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        btnGuardar.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnGuardar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/save.png"))); // NOI18N
        btnGuardar.setText("Guardar");
        btnGuardar.setBorderPainted(false);
        btnGuardar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnGuardar.setMaximumSize(new java.awt.Dimension(57, 29));
        btnGuardar.setMinimumSize(new java.awt.Dimension(57, 29));
        btnGuardar.setPreferredSize(new java.awt.Dimension(57, 29));
        btnGuardar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        btnActualizar.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnActualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/refresh.png"))); // NOI18N
        btnActualizar.setText("Actualizar");
        btnActualizar.setBorderPainted(false);
        btnActualizar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnActualizar.setMaximumSize(new java.awt.Dimension(57, 29));
        btnActualizar.setMinimumSize(new java.awt.Dimension(57, 29));
        btnActualizar.setPreferredSize(new java.awt.Dimension(57, 29));
        btnActualizar.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Demanda Turno Mañana"));

        btnSimularTurno1.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnSimularTurno1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/settings.png"))); // NOI18N
        btnSimularTurno1.setText("Simular");
        btnSimularTurno1.setBorderPainted(false);
        btnSimularTurno1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnSimularTurno1.setMaximumSize(new java.awt.Dimension(57, 29));
        btnSimularTurno1.setMinimumSize(new java.awt.Dimension(57, 29));
        btnSimularTurno1.setPreferredSize(new java.awt.Dimension(57, 29));
        btnSimularTurno1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        btnAsignarTurno1.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnAsignarTurno1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/checkmark.png"))); // NOI18N
        btnAsignarTurno1.setText("Asignar");
        btnAsignarTurno1.setBorderPainted(false);
        btnAsignarTurno1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnAsignarTurno1.setMaximumSize(new java.awt.Dimension(57, 29));
        btnAsignarTurno1.setMinimumSize(new java.awt.Dimension(57, 29));
        btnAsignarTurno1.setPreferredSize(new java.awt.Dimension(57, 29));
        btnAsignarTurno1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        tblTurno1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Producto", "Cantidad"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Integer.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane2.setViewportView(tblTurno1);
        tblTurno1.getColumnModel().getColumn(1).setMaxWidth(60);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnSimularTurno1, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnAsignarTurno1, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnSimularTurno1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAsignarTurno1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Demanda Turno Noche"));

        btnSimularTurno3.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnSimularTurno3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/settings.png"))); // NOI18N
        btnSimularTurno3.setText("Simular");
        btnSimularTurno3.setBorderPainted(false);
        btnSimularTurno3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnSimularTurno3.setMaximumSize(new java.awt.Dimension(57, 29));
        btnSimularTurno3.setMinimumSize(new java.awt.Dimension(57, 29));
        btnSimularTurno3.setPreferredSize(new java.awt.Dimension(57, 29));
        btnSimularTurno3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        btnAsignarTurno3.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnAsignarTurno3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/checkmark.png"))); // NOI18N
        btnAsignarTurno3.setText("Asignar");
        btnAsignarTurno3.setBorderPainted(false);
        btnAsignarTurno3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnAsignarTurno3.setMaximumSize(new java.awt.Dimension(57, 29));
        btnAsignarTurno3.setMinimumSize(new java.awt.Dimension(57, 29));
        btnAsignarTurno3.setPreferredSize(new java.awt.Dimension(57, 29));
        btnAsignarTurno3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        tblTurno3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Producto", "Cantidad"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Integer.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane5.setViewportView(tblTurno3);
        tblTurno3.getColumnModel().getColumn(1).setMaxWidth(60);

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnSimularTurno3, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnAsignarTurno3, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnSimularTurno3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAsignarTurno3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Demanda Turno Tarde"));

        btnSimularTurno2.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnSimularTurno2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/settings.png"))); // NOI18N
        btnSimularTurno2.setText("Simular");
        btnSimularTurno2.setBorderPainted(false);
        btnSimularTurno2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnSimularTurno2.setMaximumSize(new java.awt.Dimension(57, 29));
        btnSimularTurno2.setMinimumSize(new java.awt.Dimension(57, 29));
        btnSimularTurno2.setPreferredSize(new java.awt.Dimension(57, 29));
        btnSimularTurno2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        btnAsignarTurno2.setFont(new java.awt.Font("Ubuntu", 0, 10)); // NOI18N
        btnAsignarTurno2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/checkmark.png"))); // NOI18N
        btnAsignarTurno2.setText("Asignar");
        btnAsignarTurno2.setBorderPainted(false);
        btnAsignarTurno2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnAsignarTurno2.setMaximumSize(new java.awt.Dimension(57, 29));
        btnAsignarTurno2.setMinimumSize(new java.awt.Dimension(57, 29));
        btnAsignarTurno2.setPreferredSize(new java.awt.Dimension(57, 29));
        btnAsignarTurno2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        tblTurno2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Producto", "Cantidad"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Integer.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane6.setViewportView(tblTurno2);
        tblTurno2.getColumnModel().getColumn(1).setMaxWidth(60);

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnSimularTurno2, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnAsignarTurno2, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnSimularTurno2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnAsignarTurno2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                .addGap(178, 178, 178)
                .addComponent(btnActualizar, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(89, 89, 89)
                .addComponent(btnGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(27, 27, 27)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(61, 61, 61))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnActualizar, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(34, 34, 34)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jTextField15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField15ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField15ActionPerformed

    
    public void mostrarError(String msn){
        Validaciones.mostrarMensajeErrorVal(msn);           
    }
    
    public void mostrarAviso(String msn){
        Validaciones.mostrarMensajeAvisoVal(msn);   
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnActualizar;
    private javax.swing.JButton btnAsignarTurno1;
    private javax.swing.JButton btnAsignarTurno2;
    private javax.swing.JButton btnAsignarTurno3;
    private javax.swing.JButton btnEditar3;
    private javax.swing.JButton btnEditar7;
    private javax.swing.JButton btnEditar8;
    private javax.swing.JButton btnGuardar;
    private javax.swing.JButton btnSimularTurno1;
    private javax.swing.JButton btnSimularTurno2;
    private javax.swing.JButton btnSimularTurno3;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTextField jTextField13;
    private javax.swing.JTextField jTextField14;
    private javax.swing.JTextField jTextField15;
    private javax.swing.JTable tblPedidos;
    private javax.swing.JTable tblTurno1;
    private javax.swing.JTable tblTurno2;
    private javax.swing.JTable tblTurno3;
    // End of variables declaration//GEN-END:variables
}
